package uk.co.kevinlockwood.kol.pages;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

/**
 * Base page interface which all pages within KoL can extend
 * Data populated by the KoLPageBuilder
 * @author kevin
 **/
public abstract class KoLPage {
	/** return the page name to load in KoL (eg. "main.php?location=5") **/
	public String pageName() {
		return null;
	}

	/** return the full url to load elsewhere - pageName must return null for this to be called **/
	public URL fullUrl() throws MalformedURLException {
		return null;
	}

	/** this will be given the headers by the KoLPageBuilder - return false if you don't want the html **/
	public Boolean readHeader(String name, String value) {
		return Boolean.TRUE;
	}

	/** this will be given the full html by the KoLPageBuilder, after the headers have been handed in **/
	public void buildFromHtml(List<String> html) {
		return;
	}

	/** whether or not the page builder should follow redirects **/
	public Boolean followRedirects() {
		return Boolean.FALSE;
	}
}
